package com.iot.core.springboot;

import com.iot.core.manager.htcls.HtClsManager;
import com.iot.core.manager.htctl.HtCtlManager;
import com.iot.core.manager.job.DbJobManager;
import com.iot.core.manager.job.JobManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Slf4j

@Component
@Order(1)

public class MyApplicationRunner  implements ApplicationRunner {
    @Autowired
    HtClsManager htClsManager;
    @Autowired
    HtCtlManager htCtlManager;
     @Autowired
     JobManager jobManager;
     @Autowired
    DbJobManager dbJobManager;
    @Override
    public void run(ApplicationArguments applicationArguments) throws Exception {

        log.info("我是Spring容器启动后立即执行的方法");
        htClsManager.start();
        htCtlManager.start();
        jobManager.start();
        dbJobManager.start();

//        var pjrName="com.iot.core";
//        htClsManager.refreshToDb(pjrName);
//        htCtlManager.refreshToDb(pjrName);
//
//        HTCtlManager.getInstance().start();
//
//        AuthManager.getInstance().start();

        //JobManager.getInstance().start();
        //DBJobManager.getInstance().start();
    }
}
